import request from '../utils/request';
  
  export function register(data )  {
    console.log(data, 'data')
    return request({
      url: '/api/user/register',
      method: 'POST',
      data
    });
  }
  
  export function login(params )  {
    return request({
      url: '/api/user/login',
      method: 'POST',
      params
    });
  }
  
  export function searchAllUserData(data )  {
    return request({
      url: '/api/findAllUser',
      method: 'GET',
      data
    });
  }
  export function getUserInfo(data )  {
    return request({
      url: '/api/user/userInfo',
      method: 'GET',
      data
    });
  }

  export function updateUser(data )  {
    return request({
      url: '/api/user/update',
      method: 'PUT',
      data
    });
  }
  export function updateAva(params )  {
    return request({
      url: '/api/user/updateAvatar',
      method: 'PATCH',
      params
    });
  }
  export function resetPassword(params )  {
    return request({
      url: '/api/user/resetPassword',
      method: 'PATCH',
      params
    });
  }


  export function uploadFile(data )  {
    return request({
      url: '/api/upload',
      method: 'POST',
      data,
      headers: {
        'content-type': 'multipart/form-data'
      }
    });
  }